Programmers frequently use the Dijkstra and Floyd-Warshall algorithms for finding a shortest path (paths couple nodes together via one or more links, path and route are interchangeable; links directly couple two nodes). Dijkstra's algorithm makes it possible to find a shortest travel time value from a starting node to all other nodes in a network; the paths having non-negative costs. Cost can be, for example, monetary, hop-count, or latency. Dijkstra's algorithm finds the path with lowest cost (i.e., the shortest path) between a node and every other node. It can also find the shortest paths from a first node to a second node by stopping the algorithm once the shortest path to the second node has been determined. For example, if the nodes of the graph represent cities and edge-path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, these algorithms are widely used in network routing protocols, most notably intermediate system to intermediate system (IS-IS) and Open Shortest Path First (OSPF).
If the cost of a link changes, OSPF, for example, implements Link State Update (LSU) packets to notify all other nodes of the update and to recompute routing tables. OSPF floods or broadcasts LSUs to all routers such that each router can maintain a table of the shortest path.